#include "Comm.h"

Comm::Comm()
{
	m_Id = "";
	m_Name = "";
	m_Surname = "";
}

Comm::Comm(const string& name, const string& surname)
{
	m_Id = "";
	m_Name = name;
	m_Surname = surname;
}

Comm::Comm(const string& name, const string& surname, const string& id)
{
	m_Id = id;
	m_Name = name;
	m_Surname = surname;
}

Comm::Comm(const Comm& comm):
         m_Id ( comm.m_Id      ),
       m_Name ( comm.m_Name    ),
    m_Surname ( comm.m_Surname )
{

}

Comm& Comm::operator = (const Comm& comm)
{
          m_Id = comm.m_Id;
        m_Name = comm.m_Name;
     m_Surname = comm.m_Surname;
}

string Comm::Id(void) const { return (m_Id); }

string Comm::Name(void) const  { return (m_Name); }

string Comm::Surname(void) const { return (m_Surname); }

void Comm::Id(const string& id) { m_Id = id; }
void Comm::Name(const string& name) { m_Name = name; }
void Comm::Surname(const string& surname) { m_Surname = surname; }

void Comm::PPrn(Page& p_buff)
{
	string s;
	p_buff.add_line("COMMITTENTE");
	p_buff.add_line("===========");
    s.append("         Nome = ");
	s.append(m_Name);
	p_buff.add_line(s);
	s.erase();
	s.append("Cognome/Sigla = ");
	s.append(m_Surname);
	p_buff.add_line(s);
	s.erase();
    s.append("           ID = ");
	s.append(m_Id);
	p_buff.add_line(s);
}

bool Comm::isEmpty(void) const
{
    if (m_Id.empty() && m_Surname.empty())
        return true;
}

void Comm::setEmpty( void )
{
    m_Id="";
    m_Surname="";
    m_Name="";
}
